home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-01 | 1.4 KB | 71 lines | [TEXT/MPS ] |
- # Applies changes described in a set of difference files.
- # Larry Rosenstein 6/30/90
-
- # To create the difference file do:
- # compare -v <newfile> <oldfile> > <oldfile>.Diff
-
- # To apply the differences, do:
- # Converter
- # and select the directories containing the files to be converted and the
- # difference files. The script will perform the conversion and rename the
- # original file to "<file>.original".
-
- #
-
- set iDir `getfilename -d -m 'Select Source directory.'`
- set dDir `getfilename -d -m 'Select Diffs directory.'`
-
- for file in `files -s -f "{dDir}"┼.Diff`
- if "{file}" =~ /┼:(┼)¿1.Diff/
- set src "{iDir}{¿1}"
- set diff "{file}"
- set cvt "{src}.converted"
-
- echo "Converting {src}."
-
- duplicate "{src}" "{cvt}"
- target "{diff}"; find ░
-
- loop
- target "{diff}"; find \Ñ┼╢(File\ || break
-
- if "`catenate ñ`" =~ /(┼)¿1┼/
- set change "{¿1}"
- end
-
- find /Line [┬;]+;/
- if "`catenate ñ`" =~ /Line ([┬;]+)¿1;/
- set newSel "{¿1}"
- end
-
- find /Line ┼╢)/
- if "`catenate ñ`" =~ /Line (┼)¿1╢)/
- set oldSel "{¿1}"
- end
-
- find ╞!1
- if "{newSel}" =~ /([0-9]+)¿8:([0-9]+)¿9/
- copy ñ:!`evaluate "{¿9}"-"{¿8}"`
- else
- copy !0
- end
-
- target "{cvt}"
- if "{change}" =~ /extra lines in 2┼/
- clear {oldSel}
- else
- find {oldSel}
- paste ñ
- end
-
- target "{diff}"; find \Ñ┼╢(File┼░\
- end
- end
-
- close -y "{cvt}"
- close -n "{diff}"
-
- rename "{src}" "{src}.original"
- rename "{cvt}" "{src}"
- end
-